<template>
  <div>
    <el-input
        type="textarea"
        :autosize="{ minRows: 4, maxRows: 8}"
        placeholder="请输入内容"
        v-model="sqlContent">
    </el-input>


  </div>
</template>

<script scoped>
import sqlFormatter from 'sql-formatter-handle-space'

export default {
  name: 'panelSql',
  props: {
    parameter: Object
  },
  components: {},
  data() {
    return {
      sqlContent: 'SELECT * FROM bs_user'
    }
  },
  methods: {
    sqlFormat() {
      this.sqlContent = sqlFormatter.format(this.sqlContent)
    },
    run() {
      this.$ipcRequest.request({
        method: 'runSql',
        param: {
          sql: this.sqlContent,
          dbInfo: this.parameter
        }
      }, ({data, message, code}) => {
        if (code === 0) {
          console.log(data)
        } else {
          this.$message.error(message)
        }
      })
    }
  },
  mounted() {
  },
  created() {

  },

}
</script>

<style scoped>

</style>
